import AigcIcon from '@/components/AigcIcon'
import { Input, Modal, ModalProps } from 'antd'
import React, { useCallback } from 'react'

export default function TopUp(
  params: {
    sourceData: any
    getNumber?: any
  } & ModalProps
) {
  const getNum = useCallback((e: any) => {
    params.getNumber(e.target.value)
  }, [])

  return (
    <>
      <Modal
        {...params}
        title={
          <>
            <AigcIcon iconName="chongzhijine"></AigcIcon>
            <span>充值</span>
          </>
        }
      >
        <Input
          prefix={<AigcIcon iconName="chongzhijine"></AigcIcon>}
          defaultValue={params.sourceData}
          onChange={getNum}
        ></Input>
      </Modal>
    </>
  )
}
